package com.google.monkeyjump;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

import com.google.monkeyjump.db.DataBaseAdapter;
import com.google.monkeyjump.db.DataBaseHelper;
import com.google.monkeyjump.ranking.Classification;
import com.google.monkeyjump.ranking.Rank;

public class MainMenu extends Activity {
	
	private DataBaseHelper dataBaseHelper;

	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        final Button configureButton = (Button) findViewById(R.id.configure_button);
        
        DataBaseAdapter.getInstance(this);

        configureButton.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
                        Intent settingsButton = new Intent(MainMenu.this, SettingsMenu.class);
                        startActivity(settingsButton);
                	
                }
        });

        Button rankingButton = (Button) findViewById(R.id.rank_button);
        rankingButton.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {                    
                	Intent rank = new Intent(MainMenu.this, RankListActivity.class);
                    startActivity(rank);
                }
        });

        Button startButton = (Button) findViewById(R.id.start_button);
        startButton.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
                        Intent game = new Intent(MainMenu.this, GameActivity.class);
                        startActivity(game);  
                }
        });
    }
    
	public void toast(String message) {
        Toast toast = Toast.makeText(this, message, Toast.LENGTH_LONG);
        toast.show();

    }
    
    @Override
    protected void onDestroy() {
    	super.onDestroy();
    	DataBaseAdapter.destroy();
    }
    
}